[POWERPC][XEN] Builtin cmdline dependency rule
authorHollis Blanchard <hollisb@us.ibm.com>
Thu, 5 Oct 2006 20:48:26 +0000 (15:48 -0500)
committerHollis Blanchard <hollisb@us.ibm.com>
Thu, 5 Oct 2006 20:48:26 +0000 (15:48 -0500)
Rebuild cmdline.o when the user changes the CMDLINE=X argument passed to
the make invocation. I couldn't find an example of another project that
handles this case properly, so I came up with this.
Signed-off-by: Amos Waterland <apw@us.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
--HG--
extra : transplant_source : %1D0%5E%9CslQ%E7E%CC%8FS%B8%E1%E5%C5i%ED%F1%BE

.hgignore
xen/arch/powerpc/Makefile

index 8e06df448d24ec93f7620d289a91aa106be3dd45..da7b38f898cfde53edcef9b3dfbf2a32412ddb22 100644 (file)
--- a/.hgignore
+++ b/.hgignore
 ^xen/arch/powerpc/xen\.lds$
 ^xen/arch/powerpc/.xen-syms$
 ^xen/arch/powerpc/xen-syms.S$
+^xen/arch/powerpc/cmdline.dep$
 ^unmodified_drivers/linux-2.6/\.tmp_versions
 ^unmodified_drivers/linux-2.6/.*\.cmd$
 ^unmodified_drivers/linux-2.6/.*\.ko$
index 32a049c001e6423064c2f287052912785af3d105..4657c9bedf6e19d69a780bb73268eef82fc24f0a 100644 (file)
@@ -80,6 +80,20 @@ ifneq ($(CMDLINE),)
 # The first token in the arguments will be silently dropped.
 FULL_CMDLINE := xen $(CMDLINE)
 endif
+
+ifeq ($(wildcard cmdline.dep),)
+cmdline.dep:
+       echo $(FULL_CMDLINE) > cmdline.dep
+else
+ifneq ($(FULL_CMDLINE),$(shell cat cmdline.dep))
+cmdline.dep::
+       echo $(FULL_CMDLINE) > cmdline.dep
+else
+cmdline.dep:
+endif
+endif
+
+cmdline.o: cmdline.dep
 cmdline.o: CFLAGS += -DCMDLINE="\"$(FULL_CMDLINE)\""
 
 TARGET_OPTS = $(OMAGIC) -Wl,-Ttext,0x400000,-T,xen.lds
@@ -123,4 +137,4 @@ dom0.bin: $(DOM0_IMAGE)
 
 clean::
        $(MAKE) -f $(BASEDIR)/Rules.mk -C of_handler clean
-       rm -f firmware firmware_image.bin dom0.bin .xen-syms
+       rm -f firmware firmware_image.bin dom0.bin .xen-syms cmdline.dep